#include "ros/ros.h"
#include "plumbing_server_client/AddInts.h"

bool add_two_ints(plumbing_server_client::AddInts::Request &request,
                plumbing_server_client::AddInts::Response &responce)
{
    ROS_INFO("request.num1=%d and request.num2=%d", request.num1, request.num2);
    responce.sum = request.num1 + request.num2;
    return true;
}
int main(int argc, char **argv)
{
    ros::init(argc, argv, "heishui");
    
    ros::NodeHandle n;
    // 处理服务对象
    ros::ServiceServer server = n.advertiseService("add_ints", add_two_ints);
    ROS_INFO("heishui is alive!");
    // 处理请求并产生相应
    ros::spin();
}